Integrand size = 25, antiderivative size = 555 \[ \int \frac {1}{\sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2} \, dx=\frac {5 a b^{3/2} \arctan \left (\frac {\sqrt {b} \sqrt [4]{\sec ^2(e+f x)}}{\sqrt [4]{a^2+b^2}}\right ) \sqrt [4]{\sec ^2(e+f x)}}{2 \left (a^2+b^2\right )^{9/4} f \sqrt {d \sec (e+f x)}}-\frac {5 a b^{3/2} \text {arctanh}\left (\frac {\sqrt {b} \sqrt [4]{\sec ^2(e+f x)}}{\sqrt [4]{a^2+b^2}}\right ) \sqrt [4]{\sec ^2(e+f x)}}{2 \left (a^2+b^2\right )^{9/4} f \sqrt {d \sec (e+f x)}}+\frac {\left (2 a^2-3 b^2\right ) E\left (\left .\frac {1}{2} \arctan (\tan (e+f x))\right |2\right ) \sqrt [4]{\sec ^2(e+f x)}}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {\left (2 a^2-3 b^2\right ) \tan (e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {5 a^2 b \cot (e+f x) \operatorname {EllipticPi}\left (-\frac {b}{\sqrt {a^2+b^2}},\arcsin \left (\sqrt [4]{\sec ^2(e+f x)}\right ),-1\right ) \sqrt [4]{\sec ^2(e+f x)} \sqrt {-\tan ^2(e+f x)}}{2 \left (a^2+b^2\right )^{5/2} f \sqrt {d \sec (e+f x)}}+\frac {5 a^2 b \cot (e+f x) \operatorname {EllipticPi}\left (\frac {b}{\sqrt {a^2+b^2}},\arcsin \left (\sqrt [4]{\sec ^2(e+f x)}\right ),-1\right ) \sqrt [4]{\sec ^2(e+f x)} \sqrt {-\tan ^2(e+f x)}}{2 \left (a^2+b^2\right )^{5/2} f \sqrt {d \sec (e+f x)}}+\frac {b \left (2 a^2-3 b^2\right ) \sec ^2(e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {2 (b+a \tan (e+f x))}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))} \]
[Out]
Time = 0.67 (sec) , antiderivative size = 555, normalized size of antiderivative = 1.00, number of steps used = 18, number of rules used = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.640, Rules used = {3593, 755, 849, 858, 233, 202, 760, 408, 504, 1227, 551, 455, 65, 304, 211, 214} \[ \int \frac {1}{\sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2} \, dx=-\frac {5 a^2 b \sqrt {-\tan ^2(e+f x)} \cot (e+f x) \sqrt [4]{\sec ^2(e+f x)} \operatorname {EllipticPi}\left (-\frac {b}{\sqrt {a^2+b^2}},\arcsin \left (\sqrt [4]{\sec ^2(e+f x)}\right ),-1\right )}{2 f \left (a^2+b^2\right )^{5/2} \sqrt {d \sec (e+f x)}}+\frac {5 a^2 b \sqrt {-\tan ^2(e+f x)} \cot (e+f x) \sqrt [4]{\sec ^2(e+f x)} \operatorname {EllipticPi}\left (\frac {b}{\sqrt {a^2+b^2}},\arcsin \left (\sqrt [4]{\sec ^2(e+f x)}\right ),-1\right )}{2 f \left (a^2+b^2\right )^{5/2} \sqrt {d \sec (e+f x)}}+\frac {\left (2 a^2-3 b^2\right ) \sqrt [4]{\sec ^2(e+f x)} E\left (\left .\frac {1}{2} \arctan (\tan (e+f x))\right |2\right )}{f \left (a^2+b^2\right )^2 \sqrt {d \sec (e+f x)}}+\frac {5 a b^{3/2} \sqrt [4]{\sec ^2(e+f x)} \arctan \left (\frac {\sqrt {b} \sqrt [4]{\sec ^2(e+f x)}}{\sqrt [4]{a^2+b^2}}\right )}{2 f \left (a^2+b^2\right )^{9/4} \sqrt {d \sec (e+f x)}}-\frac {5 a b^{3/2} \sqrt [4]{\sec ^2(e+f x)} \text {arctanh}\left (\frac {\sqrt {b} \sqrt [4]{\sec ^2(e+f x)}}{\sqrt [4]{a^2+b^2}}\right )}{2 f \left (a^2+b^2\right )^{9/4} \sqrt {d \sec (e+f x)}}+\frac {b \left (2 a^2-3 b^2\right ) \sec ^2(e+f x)}{f \left (a^2+b^2\right )^2 \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}-\frac {\left (2 a^2-3 b^2\right ) \tan (e+f x)}{f \left (a^2+b^2\right )^2 \sqrt {d \sec (e+f x)}}+\frac {2 (a \tan (e+f x)+b)}{f \left (a^2+b^2\right ) \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))} \]
[In]
[Out]
Rule 65
Rule 202
Rule 211
Rule 214
Rule 233
Rule 304
Rule 408
Rule 455
Rule 504
Rule 551
Rule 755
Rule 760
Rule 849
Rule 858
Rule 1227
Rule 3593
Rubi steps \begin{align*} \text {integral}& = \frac {\sqrt [4]{\sec ^2(e+f x)} \text {Subst}\left (\int \frac {1}{(a+x)^2 \left (1+\frac {x^2}{b^2}\right )^{5/4}} \, dx,x,b \tan (e+f x)\right )}{b f \sqrt {d \sec (e+f x)}} \\ & = \frac {2 (b+a \tan (e+f x))}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}-\frac {\left (2 b \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {\frac {1}{2} \left (-3+\frac {a^2}{b^2}\right )-\frac {a x}{2 b^2}}{(a+x)^2 \sqrt [4]{1+\frac {x^2}{b^2}}} \, dx,x,b \tan (e+f x)\right )}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)}} \\ & = \frac {b \left (2 a^2-3 b^2\right ) \sec ^2(e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {2 (b+a \tan (e+f x))}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {\left (2 b^3 \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {-\frac {a \left (a^2-4 b^2\right )}{2 b^4}-\frac {\left (2 a^2-3 b^2\right ) x}{4 b^4}}{(a+x) \sqrt [4]{1+\frac {x^2}{b^2}}} \, dx,x,b \tan (e+f x)\right )}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}} \\ & = \frac {b \left (2 a^2-3 b^2\right ) \sec ^2(e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {2 (b+a \tan (e+f x))}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {\left (5 a b \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{(a+x) \sqrt [4]{1+\frac {x^2}{b^2}}} \, dx,x,b \tan (e+f x)\right )}{2 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {\left (\left (2 a^2-3 b^2\right ) \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\sqrt [4]{1+\frac {x^2}{b^2}}} \, dx,x,b \tan (e+f x)\right )}{2 b \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}} \\ & = -\frac {\left (2 a^2-3 b^2\right ) \tan (e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {b \left (2 a^2-3 b^2\right ) \sec ^2(e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {2 (b+a \tan (e+f x))}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}-\frac {\left (5 a b \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {x}{\left (a^2-x^2\right ) \sqrt [4]{1+\frac {x^2}{b^2}}} \, dx,x,b \tan (e+f x)\right )}{2 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {\left (5 a^2 b \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\left (a^2-x^2\right ) \sqrt [4]{1+\frac {x^2}{b^2}}} \, dx,x,b \tan (e+f x)\right )}{2 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {\left (\left (2 a^2-3 b^2\right ) \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\left (1+\frac {x^2}{b^2}\right )^{5/4}} \, dx,x,b \tan (e+f x)\right )}{2 b \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}} \\ & = \frac {\left (2 a^2-3 b^2\right ) E\left (\left .\frac {1}{2} \arctan (\tan (e+f x))\right |2\right ) \sqrt [4]{\sec ^2(e+f x)}}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {\left (2 a^2-3 b^2\right ) \tan (e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {b \left (2 a^2-3 b^2\right ) \sec ^2(e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {2 (b+a \tan (e+f x))}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}-\frac {\left (5 a b \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\left (a^2-x\right ) \sqrt [4]{1+\frac {x}{b^2}}} \, dx,x,b^2 \tan ^2(e+f x)\right )}{4 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {\left (5 a^2 \cot (e+f x) \sqrt [4]{\sec ^2(e+f x)} \sqrt {-\tan ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {x^2}{\sqrt {1-x^4} \left (1+\frac {a^2}{b^2}-x^4\right )} \, dx,x,\sqrt [4]{\sec ^2(e+f x)}\right )}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}} \\ & = \frac {\left (2 a^2-3 b^2\right ) E\left (\left .\frac {1}{2} \arctan (\tan (e+f x))\right |2\right ) \sqrt [4]{\sec ^2(e+f x)}}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {\left (2 a^2-3 b^2\right ) \tan (e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {b \left (2 a^2-3 b^2\right ) \sec ^2(e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {2 (b+a \tan (e+f x))}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}-\frac {\left (5 a b^3 \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {x^2}{a^2+b^2-b^2 x^4} \, dx,x,\sqrt [4]{\sec ^2(e+f x)}\right )}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {\left (5 a^2 b \cot (e+f x) \sqrt [4]{\sec ^2(e+f x)} \sqrt {-\tan ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\left (\sqrt {a^2+b^2}-b x^2\right ) \sqrt {1-x^4}} \, dx,x,\sqrt [4]{\sec ^2(e+f x)}\right )}{2 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {\left (5 a^2 b \cot (e+f x) \sqrt [4]{\sec ^2(e+f x)} \sqrt {-\tan ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\left (\sqrt {a^2+b^2}+b x^2\right ) \sqrt {1-x^4}} \, dx,x,\sqrt [4]{\sec ^2(e+f x)}\right )}{2 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}} \\ & = \frac {\left (2 a^2-3 b^2\right ) E\left (\left .\frac {1}{2} \arctan (\tan (e+f x))\right |2\right ) \sqrt [4]{\sec ^2(e+f x)}}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {\left (2 a^2-3 b^2\right ) \tan (e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {b \left (2 a^2-3 b^2\right ) \sec ^2(e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {2 (b+a \tan (e+f x))}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}-\frac {\left (5 a b^2 \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}-b x^2} \, dx,x,\sqrt [4]{\sec ^2(e+f x)}\right )}{2 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {\left (5 a b^2 \sqrt [4]{\sec ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}+b x^2} \, dx,x,\sqrt [4]{\sec ^2(e+f x)}\right )}{2 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}+\frac {\left (5 a^2 b \cot (e+f x) \sqrt [4]{\sec ^2(e+f x)} \sqrt {-\tan ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \sqrt {1+x^2} \left (\sqrt {a^2+b^2}-b x^2\right )} \, dx,x,\sqrt [4]{\sec ^2(e+f x)}\right )}{2 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {\left (5 a^2 b \cot (e+f x) \sqrt [4]{\sec ^2(e+f x)} \sqrt {-\tan ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \sqrt {1+x^2} \left (\sqrt {a^2+b^2}+b x^2\right )} \, dx,x,\sqrt [4]{\sec ^2(e+f x)}\right )}{2 \left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}} \\ & = \frac {5 a b^{3/2} \arctan \left (\frac {\sqrt {b} \sqrt [4]{\sec ^2(e+f x)}}{\sqrt [4]{a^2+b^2}}\right ) \sqrt [4]{\sec ^2(e+f x)}}{2 \left (a^2+b^2\right )^{9/4} f \sqrt {d \sec (e+f x)}}-\frac {5 a b^{3/2} \text {arctanh}\left (\frac {\sqrt {b} \sqrt [4]{\sec ^2(e+f x)}}{\sqrt [4]{a^2+b^2}}\right ) \sqrt [4]{\sec ^2(e+f x)}}{2 \left (a^2+b^2\right )^{9/4} f \sqrt {d \sec (e+f x)}}+\frac {\left (2 a^2-3 b^2\right ) E\left (\left .\frac {1}{2} \arctan (\tan (e+f x))\right |2\right ) \sqrt [4]{\sec ^2(e+f x)}}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {\left (2 a^2-3 b^2\right ) \tan (e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)}}-\frac {5 a^2 b \cot (e+f x) \operatorname {EllipticPi}\left (-\frac {b}{\sqrt {a^2+b^2}},\arcsin \left (\sqrt [4]{\sec ^2(e+f x)}\right ),-1\right ) \sqrt [4]{\sec ^2(e+f x)} \sqrt {-\tan ^2(e+f x)}}{2 \left (a^2+b^2\right )^{5/2} f \sqrt {d \sec (e+f x)}}+\frac {5 a^2 b \cot (e+f x) \operatorname {EllipticPi}\left (\frac {b}{\sqrt {a^2+b^2}},\arcsin \left (\sqrt [4]{\sec ^2(e+f x)}\right ),-1\right ) \sqrt [4]{\sec ^2(e+f x)} \sqrt {-\tan ^2(e+f x)}}{2 \left (a^2+b^2\right )^{5/2} f \sqrt {d \sec (e+f x)}}+\frac {b \left (2 a^2-3 b^2\right ) \sec ^2(e+f x)}{\left (a^2+b^2\right )^2 f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))}+\frac {2 (b+a \tan (e+f x))}{\left (a^2+b^2\right ) f \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))} \\ \end{align*}
Result contains complex when optimal does not.
Time = 35.31 (sec) , antiderivative size = 8379, normalized size of antiderivative = 15.10 \[ \int \frac {1}{\sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2} \, dx=\text {Result too large to show} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 29177 vs. \(2 (512 ) = 1024\).
Time = 11.81 (sec) , antiderivative size = 29178, normalized size of antiderivative = 52.57
[In]
[Out]
Timed out. \[ \int \frac {1}{\sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {1}{\sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2} \, dx=\int \frac {1}{\sqrt {d \sec {\left (e + f x \right )}} \left (a + b \tan {\left (e + f x \right )}\right )^{2}}\, dx \]
[In]
[Out]
\[ \int \frac {1}{\sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2} \, dx=\int { \frac {1}{\sqrt {d \sec \left (f x + e\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{2}} \,d x } \]
[In]
[Out]
\[ \int \frac {1}{\sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2} \, dx=\int { \frac {1}{\sqrt {d \sec \left (f x + e\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {1}{\sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2} \, dx=\int \frac {1}{\sqrt {\frac {d}{\cos \left (e+f\,x\right )}}\,{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^2} \,d x \]
[In]
[Out]